# Query 和 Path 综合使用

from fastapi import FastAPI, Query, Path
from typing import Optional, List, Dict
import uvicorn

app = FastAPI()


@app.get("/path_query/{item_id}")
async def read_items(*, item_id: int = Path(..., description="path", ge=1, lt=5),
                     name: str = None,
                     age: float = Query(..., description='query', gt=0.0, le=10)):
    return {"item_id": item_id, "age": age, "name": name}


if __name__ == '__main__':
    uvicorn.run(app='main2:app', host='127.0.0.1', port=8000, reload=True, debug=True)
